<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<script>
    //指针加循环 当他的小于上一个的时候 重新定义开头的数
    function fn(nums) {
        let start = 0
        let max = 0
        for (let i = 0; i < nums.length; i++) {
            if (nums[i] < nums[i - 1]) {
                start = i
            }
            max = Math.max(max, i - start + 1)
        }
        return max
    }
    console.log(fn([63, 20, 21, 23, 10, 9, 8]));
    
</script>

</html>